﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

/// <summary>
///BasePage 的摘要说明
/// </summary>
public class BasePage:System.Web.UI.Page
{
    protected int UserId;
    protected MatchIns.BLL.PageInfo PageInfo = new MatchIns.BLL.PageInfo(int.MaxValue, 1);
    protected FreeHouse.BLL.UserPower UserPower;
    protected override void OnInit(EventArgs e)
    {
        if (Session["userid"] == null)
            Response.Redirect("~/Admin/Login.aspx");
        UserId = int.Parse(Session["userid"].ToString());
        UserPower = new FreeHouse.BLL.UserPower(UserId);
        UserPower.NoActionPower += NoActionPower;
        UserPower.NoFiledPower += NoFieldPower;
    }

    public void NoActionPower(object sender, EventArgs e)
    {
        Response.Write("<h4 style='font-family:Courier New;margin:3px;'>You do not have permission to view this page, please contact the administrator!</h4>");
        Response.Write("<hr/>");
        Response.Write("<h4 style='font-family:Courier New;margin:3px;'>©2010 梅陇社区</h4>");
        Response.End();
    }

    public void NoFieldPower(object sender, EventArgs e)
    {

    }

}
